export default [
            {
                path:'/home',
                name:'home',
                component:()=> import("@/pages/Home/Home"),
                meta:{
                    title:'主页',
                    footer:true,
                }
            },
            {
                path:'/login',
                component:()=> import("@/pages/Login/Login"),
                meta:{
                    title:'欢迎登录',
                    footer:false,
                    locks:false,
                },
            },
            {
                path:'/refister',
                component:()=> import("@/pages/ReFister/ReFister"),
                meta:{
                    title:'欢迎注册',
                    footer:false,
                }
            },
            {
                path:'/search/:keyword?',
                name:'search',
                component:()=> import("@/pages/Search/Srarch"),
                meta:{
                    mytitle:true,
                    footer:true,
                },
                props(route){
                    return {
                        data:[route.query,route.params]
                    }
                }
            },
            //重新定向 根目录路由定位到首页
            {
                path:'*',//访问根目录的时候
                redirect:"/home"//跳转到此地址
            },
            {
                path:"/center",
                redirect:'/center/myorder'
            },
            {
                path:'/detail/:id',
                name:'detail',
                component:resolve => require(['@/pages/Detail/index'],resolve)//路由懒加载
            },
            {
                path:'/shoppingcart',
                name:'shopcar',
                component:resolve => require(['@/pages/AddCartSuccess/index'],resolve)
            },
            {
                path:'/settlement',
                name:'settlement',
                component:resolve => require(['@/pages/ShopCart/index'],resolve),
                beforeEnter: (to, from, next) => {
                    if(from.path === '/shoppingcart'){
                        next()
                    }else{
                        alert('您无权访问')
                        next(false)
                    }
                }
            },
            {
                path:'/trade',
                component:()=> import("@/pages/Trade/Trade"),
            },
            {
                path:'/pay',
                name:"pay",
                component:()=> import('@/pages/Pay/Pay'),
                beforeEnter: (to, from, next) => {
                    if(from.path === '/trade'){
                        next()
                    }else{
                        alert('您无权访问')
                        next(false)
                    }
                }
            },
            {
                path:'/paySuccess',
                name:'paySuccess',
                component:()=> import('@/pages/PaySuccess/PaySuccess'),
                beforeEnter: (to, from, next) => {
                    if(from.path === '/pay'){
                        next()
                    }else{
                        alert('您无权访问')
                        next(false)
                    }
                }
            },{
                path:'/center',
                name:'center',
                component:()=> import('@/pages/Center/Center'),
                children:[
                    {
                        path:'myorder',
                        name:'myorder',
                        component:()=>import("@/pages/MyOrder/MyOrder")
                    },
                    {
                        path:'groupOrder',
                        name:'groupOrder',
                        component:()=>import('@/pages/GroupOrder/GroupOrder')
                    }
                ]                      
            }
    ]
